<div class="edit-admin-user-form">
  <form nz-form [formGroup]="editAdminUserForm" role="form">

    <nz-form-item>
      <nz-form-label nzFor="" nzSpan="6" nzRequired>邮箱</nz-form-label>

      <nz-form-control nzSpan="18" [nzValidateStatus]="msgFlag" nzHasFeedback>
        <input type="text" nz-input nzSize="default" formControlName="email" placeholder="请输入邮箱地址"
          (blur)='isEmailRepeat()'>
        <nz-form-explain *ngIf="msgFlag === 'error'">
          <span class="text-danger">
            邮箱重复!
          </span>
        </nz-form-explain>
        <nz-form-explain *ngIf="!(editAdminUserForm.get('email').valid || editAdminUserForm.get('email').untouched)">
          <span class="text-danger" *ngIf="editAdminUserForm.get('email').hasError('required')">带*项不能为空!</span>
          <span class="text-danger" *ngIf="editAdminUserForm.get('email').hasError('email')">邮箱格式不正确！</span>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="" nzSpan="6" nzRequired>名字</nz-form-label>
      <nz-form-control nzSpan="18">
        <input type="text" nz-input nzSize="default" formControlName="lastName" placeholder="名字">
        <nz-form-explain
          *ngIf="!(editAdminUserForm.get('lastName').valid || editAdminUserForm.get('lastName').untouched)">
          <span class="text-danger" *ngIf="editAdminUserForm.get('lastName').hasError('required')">带*项不能为空!</span>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="" nzSpan="6" nzRequired>姓氏</nz-form-label>
      <nz-form-control nzSpan="18">
        <input type="text" nz-input nzSize="default" formControlName="firstName" placeholder="姓氏" autocomplete="off">
        <nz-form-explain
          *ngIf="!(editAdminUserForm.get('firstName').valid || editAdminUserForm.get('firstName').untouched)">
          <span class="text-danger" *ngIf="editAdminUserForm.get('firstName').hasError('required')">带*项不能为空!</span>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-control>
        <nz-checkbox-wrapper style="width: 100%;" (nzOnChange)="passwordChange($event)">
          <label nz-checkbox formControlName="isPassword" [(ngModel)]="isPasswordChange">修改密码?</label>
        </nz-checkbox-wrapper>
      </nz-form-control>
    </nz-form-item>
    <div [hidden]="isHidden">
      <nz-form-item>
        <nz-form-control>
          <nz-checkbox-wrapper style="width: 100%;" (nzOnChange)="emailChange($event)">
            <label nz-checkbox formControlName="isEmail" [(ngModel)]="isEmailChange">发送邮件激活密码</label>
          </nz-checkbox-wrapper>
        </nz-form-control>
      </nz-form-item>

      <div [hidden]="isShow">
        <nz-form-item>
          <nz-form-label nzFor="" nzSpan="6" nzRequired>新密码</nz-form-label>
          <nz-form-control nzSpan="18">
            <input type="password" nz-input nzSize="default" formControlName="newPassword" autocomplete="off"
              placeholder="请输入密码">
            <nz-form-explain
              *ngIf="!(editAdminUserForm.get('newPassword').valid || editAdminUserForm.get('newPassword').untouched)">
              <span class="text-danger" *ngIf="editAdminUserForm.get('newPassword').hasError('required')">8-50位字符,
                且至少包括大写字母、小写字母、数字、特殊字符中的三种类型！</span>
            </nz-form-explain>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzFor="" nzSpan="6" nzRequired>确认密码</nz-form-label>
          <nz-form-control nzSpan="18">
            <input type="password" nz-input nzSize="default" formControlName="confirmPwd" autocomplete="off"
              placeholder="请确认密码">
            <nz-form-explain
              *ngIf="!(editAdminUserForm.get('confirmPwd').valid || editAdminUserForm.get('confirmPwd').untouched)">
              <span class="text-danger" *ngIf="editAdminUserForm.get('confirmPwd').hasError('required')">带*项不能为空!</span>
            </nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>


    <nz-form-item>
      <nz-form-control class="modal-footer">
        <button nz-button nzType="primary" class="modal-footer-btn"
          (click)="changeAdminUserModal()">确&nbsp;&nbsp;&nbsp;&nbsp;定</button>
        <button nz-button nzType="primary" class="modal-footer-btn" nzGhost="true"
          (click)="destroyModal()">取&nbsp;&nbsp;&nbsp;&nbsp;消</button>
      </nz-form-control>
    </nz-form-item>
  </form>
</div>